package cn.ilikes.webs.bases;

import javax.servlet.http.Cookie;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.slf4j.Logger;

import cn.ilikes.tools.logs.Loggerfactory;

import com.opensymphony.xwork2.ActionSupport;

/**
 * BaseAction类继承ActionSupport包、实现SessionAware类方法 SessionAware
 * 
 * @author
 * 
 */

public abstract class BaseAction extends ActionSupport implements ServletResponseAware, ServletRequestAware, ActionUnits {

	private static final Logger logger = Loggerfactory.instance(BaseAction.class);

	protected Integer ajaxResult;

	private static final long serialVersionUID = 325925035218044014L;

	protected HttpServletResponse response;

	protected HttpServletRequest request;

	public Integer getAjaxResult() {

		return ajaxResult;
	}

	public void setAjaxResult(Integer ajaxResult) {

		this.ajaxResult = ajaxResult;
	}

	

	@Override
	public void setServletRequest(HttpServletRequest arg0) {
		this.request = arg0;
		
	}

	@Override
	public void setServletResponse(HttpServletResponse arg0) {
		this.response = arg0;
		
	}

	protected Cookie[] getCookie() {
		Cookie[] cookies = request.getCookies();
		return cookies;
	}

	

}
